package cays.student.service;

import cays.student.dao.ScDao;
import cays.student.vo.Sc;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 选课信息服务类
 *
 * @author Chai yansheng
 * @create 2019/8/30
 **/
@Service
public class ScService {
    @Resource
    private ScDao scDao;

    public List<Sc> getAllSc() {
        return scDao.getAllSc();
    }

    public Sc getScBySnoAndCno(String sno, String cno) {
        return scDao.getScBySnoAndCno(sno, cno);
    }
    @Transactional
    public int updateScBySnoAndCno(Sc sc) {
        return scDao.updateScBySnoAndCno(sc);
    }
    @Transactional
    public int insertSc(Sc sc) {
        return scDao.insertSc(sc);
    }
    @Transactional
    public int deleteScBySnoAndCno(String sno, String cno) {
        return scDao.deleteScBySnoAndCno(sno, cno);
    }
}
